package com.example.flow.enums;

/**
 * 节点是否自动执行
 * @author safe
 * @date 2021/1/31
 */
public enum EnumAutoExecute {
    NO("N", "不自动执行"),
    YES("Y", "自动执行");

    /** 码值 */
    private String code;

    /** 描述 */
    private String desc;

    EnumAutoExecute(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static EnumAutoExecute find(String code) {
        if (code == null) {
            return null;
        }
        for (EnumAutoExecute e : EnumAutoExecute.values()) {
            if (e.code.equals(code)) {
                return e;
            }
        }
        return null;
    }

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }
}
